<?php
namespace app\model;
use app\BaseModel;
use think\model\concern\SoftDelete;
use app\model\;

class File extends BaseModel
{

    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = '0000-00-00 00:00:00';
    protected $hidden = ['update_time','delete_time','sort','status'];



    public function searchCatIdAttr($query,$value,$data){
        if(!empty($value)){
            $query->where('cat_id','=',$value);
        }
    }



    protected function setCatIdAttr($value,$data){ //当前字段的修改器
         $this->set('cat_title',::where('id',$value)->value('title'));
         return $value;
    }





}